import java.util.Map;
import java.util.TreeMap;

public class Solution732 {

    TreeMap<Integer,Integer> treeMap=new TreeMap<>();

    public Solution732() {

    }

    public int book(int start, int end) {
        treeMap.put(start,treeMap.getOrDefault(start,0)+1);
        treeMap.put(end,treeMap.getOrDefault(end,0)-1);
        int cur=0,max=0;
        for (Map.Entry<Integer, Integer> entry : treeMap.entrySet()) {
            cur+=entry.getValue();
            max=Math.max(max,cur);
        }
        return max;
    }

    public static void main(String[] args) {
        Solution732 solution732=new Solution732();
        System.out.println(solution732.book(10, 20));
        System.out.println(solution732.book(50, 60));
        System.out.println(solution732.book(10, 40));
        System.out.println(solution732.book(5, 15));
        System.out.println(solution732.book(5, 10));
        System.out.println(solution732.book(25, 55));
    }
}
